//
//  IssueView.m
//  吃货·上海
//
//  Created by 濮亚军 on 15/11/26.
//  Copyright © 2015年 濮亚军. All rights reserved.
//

#import "IssueView.h"
@interface IssueView()<UITextFieldDelegate>



@end
@implementation IssueView

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        self.textField = [[UITextField alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, frame.size.height / 9)];
        self.textField.backgroundColor = [UIColor whiteColor];
        self.textField.textAlignment = NSTextAlignmentLeft;
        self.textField.delegate = self;
        self.textField.placeholder = @"请输入内容";
        [self addSubview:_textField];
        
        self.issueImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, frame.size.height / 9, KScreenWidth, frame.size.height / 3 * 2)];
        //self.issueImageView.backgroundColor = [UIColor redColor];
        self.issueImageView.userInteractionEnabled = YES;
        [self addSubview:_issueImageView];
        CGFloat x = (self.issueImageView.frame.size.width - 62) / 2;
        CGFloat y = (self.issueImageView.frame.size.height - 62) / 2;
        self.iconImageView = [[UIImageView alloc]initWithFrame:CGRectMake(x, y, 62, 62)];
        self.iconImageView.userInteractionEnabled = NO;
        self.iconImageView.image = [UIImage imageNamed:@"addImage"];
        [self.issueImageView addSubview:_iconImageView];
        
        
        UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, self.issueImageView.frame.size.height + self.issueImageView.frame.origin.y, KScreenWidth, 10)];
        label.backgroundColor = [UIColor grayColor];
        label.alpha = 0.4;
        [self addSubview:label];
        
        self.button = [UIButton buttonWithType:UIButtonTypeCustom];
        self.button.frame = CGRectMake((KScreenWidth - 70) / 2, 2 * frame.size.height / 3 + frame.size.height / 9 + 20, 70 * KWNum, 40 * KWNum);
        //self.button.backgroundColor = [UIColor blackColor];
        [self.button setBackgroundImage:[UIImage imageNamed:@"submit"] forState:UIControlStateNormal];
        [self addSubview:_button];
    }
    return self;
}
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}



@end
